import {defaulgradient} from "../modules/maptheme.js"

export let thememetas = [
  {
    type: "fill",
    field: "",
    colorlevels: 3,
    colorgradient: defaulgradient,
    palette: [],
    legend: {
      show: true,
      calcunit: "",
      unitname: "",
    },
    highlight: false,
    opacity: 1,
    density: false,
    quantile: false,
    opacitygradient:false,
  },
  {
    type: "label",
    size: 14,
    color: "#000000",
    overlap: "",
    halowidth: 2,
    halocolor: "#FFFFFF",
  },
  {
    type: "outline",
    width: 2,
    color: "#000000",
    blur: 1,
  },
  {
    type: "chart",
    field: "",
    minsize: 20,
    maxsize: 40,
    chartype: "",
    fields: "",
  },
  {
    type: "scatter",
    field: "",
    opacity: 1,
    colorgradient: defaulgradient,
    colorlevels: 3,
    quantile: false,
    palette: [],
    minsize: 20,
    maxsize: 40,
    legend: {
      show: true,
      calcunit: "",
      unitname: "",
    },
    opacitygradient: false,
  },
  {
    type: "flow",
    pure: "",
    direction: "",
    areacode: "",
    colorlevels: 7,
    colorgradient: [],
    colorcenter: "",
    fill: false,
    legend: {
      show: true,
      calcunit: "",
      unitname: "",
    },
    minsize: 1,
    maxsize: 10,
  },
  {
    type: "heat",
    field: "",
    intensity: 0.5,
    radius: 10,
    weight: 1,
    opacity: 1,
    colorgradient:[],
  },
  {
    type: "symbol",
    field: "",
    minsize: 20,
    maxsize: 40,
    image: "",
  },
  {
    type: "iso",
    field: "",
    density: false,
  },
  {
    type: "sde",
    field: "",
    devmulti: 1,
    color: "#aa2200",
    opacity: 0.5,
  },
  {
    type: "grid",
    field: "",
    color: "#aa2200",
    opacity: 0.5,
    gridsize: 1,
    btn:true,
    quantile:true,
  },
];

export let propthemes = {};
export let themeobj = {};
for (let theme of thememetas) {
  for (let atr in theme) {
    if (!propthemes[atr]) {
      propthemes[atr] = [];
    }
    propthemes[atr].push(theme.type);
    if (!themeobj[atr]) {
      themeobj[atr] = theme[atr];
    }
  }
}
console.log(propthemes);

export let colorpats = [
  ["#c9e1f8", "#b5d888", "#e9c645", "#ee964b", "#f95738"],
  ["#006ba6", "#0496ff", "#ffbc42", "#d81159", "#8f2d56"],
];
export let chartypes = {
  pie: "饼图",
  bar: "柱状图",
  line: "折线图",
  sun: "旭日图",
};
export let areas = [
  { code: "37", name: "山东省" },
  { code: "3701", name: "济南市" },
  { code: "3702", name: "青岛市" },
  { code: "3703", name: "淄博市" },
  { code: "3704", name: "枣庄市" },
  { code: "3705", name: "东营市" },
  { code: "3706", name: "烟台市" },
  { code: "3707", name: "潍坊市" },
  { code: "3708", name: "济宁市" },
  { code: "3709", name: "泰安市" },
  { code: "3710", name: "威海市" },
  { code: "3711", name: "日照市" },
  { code: "3713", name: "临沂市" },
  { code: "3714", name: "德州市" },
  { code: "3715", name: "聊城市" },
  { code: "3716", name: "滨州市" },
  { code: "3717", name: "菏泽市" },
];

export let layerlevels = [
  { name: "省", value: "sheng" },
  { name: "市", value: "shi" },
  { name: "县", value: "xian" },
  { name: "乡", value: "xiang" },
  { name: "村", value: "cun" },
  { name: "小区", value: "xiaoqu" },
];

export let themetypes = {
  fill: "填充图",
  outline: "围栏",
  scatter: "气泡图",
  chart: "统计图",
  label: "标注",
  flow: "联系图",
  heat: "热力图",
  symbol: "符号",
  iso: "核密度",
  sde: "标准差椭圆",
  grid: "网格",
};
